package com.training.java.core.collections.Set.Car;

public class School {
	private String name;
	private String city;
	private String schoolDistrict;
	private int greatSchoolRanking;

	public School(String name, String city, int greatSchoolRanking) {

		this.name = name;
		this.city = city;
		this.greatSchoolRanking = greatSchoolRanking;
	}

	public String getName() {
		return name;
	}

	public String getCity() {
		return city;
	}

	public int getGreatSchoolRanking() {
		return greatSchoolRanking;
	}

	public String getSchoolDistrict() {
		return schoolDistrict;
	}

	@Override
	public boolean equals(Object obj) {

		School that = (School) obj;

		if (this.getName().equals(that.getName())
				&& this.getCity().equals(that.getCity())
				&& this.getGreatSchoolRanking() == (that
						.getGreatSchoolRanking()))
			return true;
		else
			return false;

	}

	@Override
	public int hashCode() {
		return this.getName().hashCode();
	}
}
